10.1 任务描述

前置任务:C4-007

业务模块:“我的”功能

实现“我的”功能。

任务类型:按步骤操作

10.2 详细实现步骤

“我的”功能主要是显示资产,从数据中读取收入和支出,两者相减就是个人的资产。

图 24 “我的”功能

private void initOwnView(){
    View view=viewList.get(2);



    TextView textviewOwn=view.findViewById(R.id.textviewOwn);

    int nAllEarnings=accountDatabase.getEarningsCount();
    int nAllExpenditures=accountDatabase.getExpendituresCount();
    Log.v("tag1",nAllEarnings+"");
    Log.v("tag1",nAllExpenditures+"");

    textviewOwn.setText("资产:"+(nAllEarnings-nAllExpenditures));


}

results matching ""

    No results matching ""